<template>
  <div class="admin-login_item5">
      <div class="item5-log">
        <div class="item5-log-deng">登录</div>
        <div class="item5-log-name">用户名：</div>
        <input class="item5-log-txtbox" v-model="user.username" placeholder="请输入您的用户名" />
        <div class="item5-log-name">密码:</div>
        <input class="item5-log-txtbox"  v-model="user.password" type="password" placeholder="请输入您的密码" />
        <div class="item5-log-check">
          <el-checkbox class="check-size" v-model="checked">我已阅读《阿拉博数企业服务条款》</el-checkbox>
          <!-- <div class="check-num"><a href="#">忘记密码?</a></div> -->
        </div>
        <div class="item5-log-buton">
          <el-button class="buton-action" @click="submit" :loading="loading">登录</el-button>
        </div>
      </div>
    </div>
</template>

<script>
  export default {
     data() {
       return {
         loading: false,
         checked: false,
         user: {
         	username: '',
         	password: ''
         }
       }
     },
     mounted() {
     	this.init()
     },
     methods: {
       async submit() {
         if (this.checked) {
           this.loading = true
           await this.$ala.userLogin(this.user)
           this.loading = false
           await this.$emit('afterLogin')
         } else {
           this.$alert('请勾选服务条款', '提示！', {
             confirmButtonText: '确定'
           })
         }
       }
     }
   }
</script>

<style lang="scss">
  .admin-login_item5 {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 1300px;
    // display: flex;
    // flex-direction: row;
    background: url("https://diyapi.5ug.com/wwwroot/uploads/api/256-116-382/2022-02-17/620de4a7051295f555289941.png");
    overflow: hidden;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    .item5-log{
      display: flex;
      flex-direction: column;
      top: 25%;
      left: 12%;
      position: absolute;
      .item5-log-deng{
        padding: 20px 20px;
        margin-left: 30px;
        color: #0089E9;
        font-size: 40px;
      }
      .item5-log-name {
        margin-top: 10px;
        color: #FFFFFF;
        font-size: 18px;
      }
      .item5-log-txtbox{
        color: #FFFFFF;
        border-radius: 5px;
        width: 260px;
        background-color: rgba(#000022,0.5);
        font-size: 14px;
        padding: 10px 10px;
        line-height: 20px;
        border: 1px solid #0089E9;
        margin: 10px 0;
      }
      .item5-log-txtbox::-webkit-input-placeholder{
         color: rgba(#ffffff,0.7);
      }
      .item5-log-check{
        width: 260px;
        //display: flex;
        // flex-direction: row;
        // align-items: center;
        // justify-content: space-between;
        .check-size{
          font-size: 10px;
          color: rgba(#ffffff,.5);
          .el-checkbox__label {
              color: #fff !important;
              font-weight: bold;
          }
        }
        .check-size:hover{
          font-size: 10px;
          color: #FFFFFF;
        }
        .check-num{
          font-size: 10px;
          color: #FFFFFF;
          border-bottom: 1px solid rgba(#ffffff,.5);
        }
        .check-num a{
          color: rgba(#ffffff,.5);
          border-bottom: 1px solid rgba(#ffffff,.5);
        }
        .check-num a:hover{
          color: #FFFFFF;
          border-bottom: 1px solid #ffffff;
        }
      }
      .item5-log-buton {
        width: 260px;
        margin-top: 40px;
        .buton-action {
          background:linear-gradient(top, #01D4F1,#0089E9);
          color: #ffffff;
          width: 260px;
          padding: 15px 0px;
          border-radius: 5px;
        }
        .buton-action:hover {
          background-color: #01D4F1;
        }
      }
    }
  }
</style>
